<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimal-ui">
    <meta name="author" content="">
    <title></title>  <link rel="icon" href="/template/pc1/images/wmh_favicon.ico" type="image/x-icon" />
    <% include("../inc/input_css.html"){}%>
    <style>
        label{
            width: 170px!important;
        }
    </style>
    <%
    var isAdd = false;
    var isEdit = false;
    if(isEmpty(navigation.id)){
    isAdd = true;
    }else{
    isEdit = true;
    }%>
</head>
<body>
<div class="ibox">
    <div class="ibox-title">
        <div class="pull-left mbx navbar_title">
            <span class="current">基础管理</span>
            <span class="line">/</span>
            <span class="current"><a href="list">导航管理</a></span><span class="line">/</span>
            <%if(isAdd){%>添加导航<%}else{%>编辑导航<%}%>
        </div>
    </div>
    <div class="ibox-content">
        <div class="wrapper wrapper-content">
            <div class="row">
                <div class="padding-40">
                    <form  action="<%if (isAdd){%>save<%}else{%>update<%}%>" method="post" class="form-horizontal form-validate">
                        <input type="hidden" name="navigation.id" value="${navigation.id!}" />
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><span class="maroon">*</span>名称</label>
                            <div class="col-sm-3">
                                <input type="text" name="navigation.name" id="productCategoryName" value="${navigation.name!}" class="form-control light-input" maxlength="10" required="true">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">链接地址</label>
                            <div class="col-sm-3">
                                <input type="text"  name="navigation.url"  value="${navigation.url!}" class="form-control light-input">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">位置</label>
                            <div class="col-sm-3">
                                <select name="position" class="form-control light-input">
                                    <option value="top" <%if (isAdd || navigation.position! == "top"){%>selected="selected" <%}%>>${i18n("Position.top")}</option>
                                    <option value="middle" <%if (isAdd || navigation.position! == "middle"){%>selected="selected" <%}%>>${i18n("Position.middle")}</option>
                                    <option value="bottom" <%if (isAdd || navigation.position! == "bottom"){%>selected="selected" <%}%>>${i18n("Position.bottom")}</option>
                                </select>

                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">是否显示</label>
                            <div class="col-sm-3 col-md-3  col-lg-2 ">
                                <div class="right_cont_r radio i-checks">
                                    <input type="radio" value="true" name="navigation.isVisible" <%if (navigation.isVisible! == true){%> checked<%}%>><span style="margin-right: 15px;">是</span>
                                    <input type="radio" value="false" name="navigation.isVisible" class="right_cont_r_l" <%if (isAdd || navigation.isVisible == false){%> checked<%}%>><span>否</span>
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">是否在新窗口中打开</label>
                            <div class="col-sm-3 col-md-3  col-lg-2 ">
                                <div class="right_cont_r radio i-checks">
                                    <input type="radio" value="true" name="navigation.isBlankTarget" <%if (navigation.isBlankTarget! == true){%> checked<%}%>><span style="margin-right: 15px;">是</span>
                                    <input type="radio" value="false" name="navigation.isBlankTarget" class="right_cont_r_l" <%if (isAdd || navigation.isBlankTarget == false){%> checked<%}%>><span>否</span>
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><span class="maroon">*</span>排序</label>
                            <div class="col-sm-3">
                                <input type="text" name="navigation.orderList"  value="${navigation.orderList!}" class="form-control light-input" maxlength="10" required="true">
                            </div>
                        </div>
                        <div class="form-group" style="margin-top: 24px">
                            <label class="col-sm-2 control-label "></label>
                            <div class="col-sm-4 col-sm-offset-0">
                                <button class="hive-btn-cancle" id="btn_cancle" type="button" onclick="history.back()">&nbsp;取消&nbsp;</button>
                                <button class="hive-btn hive-btn-primary margin-left-8" type="submit">&nbsp;提交&nbsp;
                                </button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>

</body>
<script>
    function check(){
        var navigationName=$("#navigationName").val();
        var navigationUrl=$("#navigationUrl").val();
        var orderList=$("input[name='navigation.orderList']").val();
        var listReg=/^\d*\d*\d+$/;
        if(!navigationName){
            layer.msg("请输入名称!");
            return false;
        }
        if(!navigationUrl){
            layer.msg("请输入链接地址!");
            return false;
        }
        if(!listReg.test(orderList) || parseInt(orderList)>999){
            layer.msg("排序请输入0-999的正整数!");
            return false;
        }
    }
</script>
<% include("../inc/input_js.html"){}%>
<script type="text/javascript">
    var uploadUrl="/file/uploadfile?shopId=${shopId!}&type=d";
    var browserUrl="/file/browser?shopId=${shopId!}";
</script>
<script src="https://static.9hive.cn/global/vendor/file/file.js"></script>
<script type="text/javascript">
    $(function () {
        $("input.browserButton").browser();
        $('.i-checks').iCheck({
            checkboxClass: 'icheckbox_flat-blue',
            radioClass: 'iradio_flat-blue',
        });

    })
</script>
</html>